/*
 *  Item.cpp
 *  TractionEdge
 *
 *  Created by Steven Hamilton on 26/08/09.
 *  Copyright 2009 scorch.org. All rights reserved.
 *
 */
#include <iostream>
#include "defines.h"
#include "GameWorld.h"
#include "Item.h"
#include "Logger.h"


Item::Item()
{
}

Item::~Item()
{
}

Item::Item(itemType_t item, int ownerId)
{
	objectId=WORLD.getObjectId();
    onMap = false;
	ownerObjectId=ownerId;
	switch (item) {
		case CORPSE:
            type=item;
			gfxId=CORPSE_S;
			name="Corpse";
			weight=180;
			break;
		case PISTOL:
//			std::cout << "Creating Pistol" << std::endl;
			type=item;
            name=WEAPON_PISTOL_NAME;
			gfxId=WEAPON_S;
			skill="Pistol";
			weight=50;
			properties["damage"] = WEAPON_PISTOL_DAMAGE;
			properties["range"] = WEAPON_PISTOL_RANGE;
			break;
		case RIFLE:
//			std::cout << "Creating Rifle" << std::endl;
			type=item;
			name = WEAPON_RIFLE_NAME;
			gfxId = WEAPON_S;
			skill = "Rifle";
			weight = 100;
			properties["damage"] = WEAPON_RIFLE_DAMAGE;
			properties["range"] = WEAPON_RIFLE_RANGE;
			break;
		case ARMOUR_IRON:
			gfxId=ARMOUR_S;
			name="Iron suit";
			properties["armourClass"]=4;
			break;
		case ARMOUR_LEATHER:
			gfxId=ARMOUR_S;
			name="Leather Jacket";
			properties["armourClass"]=2;
			break;
		default:
			break;
	}
	LOG(objectId,"Creating Item");
}

